/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019.
 * Description: vector page protect support
 * Author: qiuxi
 * Create: 2019-01-27
 */

#ifndef VECTOR_PAGE_WRPROTECT
#define VECTOR_PAGE_WRPROTECT

#ifdef CONFIG_ARM_LPAE
#define MAP_BIT_APX 7
#else
#define MAP_BIT_APX 15
#endif

/*
 * This function needs to be used with vectors_page_wrprotect(),
 * and both functions, as well as code within the scope of both
 * functions, need to be used when preemption is disabled.
 */
extern void vectors_page_wrable(void);

/*
 * This function needs to be used with vectors_page_wrable(),
 * and both functions, as well as code within the scope of both
 * functions, need to be used when preemption is disabled.
 */
extern void vectors_page_wrprotect(void);

void vectors_page_wrprotect_init(void);
int get_vectors_page_wrprotect(void);

#endif /* VECTOR_PAGE_WRPROTECT */
